package com.xltt.vehicleControl.iApiService;


import com.xltt.vehicleControl.bean.BaseData;
import com.xltt.vehicleControl.bean.BaseResult;
import com.xltt.vehicleControl.bean.DiagnosticsResponse;
import com.xltt.vehicleControl.bean.PushConfig;
import com.xltt.vehicleControl.bean.RemoteControlRequest;
import com.xltt.vehicleControl.bean.RemoteControlResponse;
import com.xltt.vehicleControl.bean.TcVehicleProfileResponse;
import com.xltt.vehicleControl.bean.TscVehicleCapabilityResponse;
import com.xltt.vehicleControl.bean.UpdateSession;
import com.xltt.vehicleControl.bean.VehicleState;
import com.xltt.vehicleControl.bean.VehicleStatusResponse;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import io.reactivex.Observable;


public interface IVehicleControlService {
    /**
     * 获取当前用户账号下的车辆信息
     * @param userId 当前用户的用户id
     * @return
     */
    @Headers("urlname:user-api")
    @GET("api/v1/vehicle/{userId}")
    Observable<BaseResult<TcVehicleProfileResponse>> getVehicleList(@Path("userId") String userId, @Query("type") String type);

    /**
     * 获取车辆列表 v2版本,缺少"cspAccountState""carFromSoure两个字段
     */
    @Headers("urlname:device-api")
    @GET("/device-platform/user/vehicle/secure")
    Observable<BaseResult<TcVehicleProfileResponse>> getVehicleListNew(@Query("userId") String userId);

    /**
     * 远程控制车辆
     */
    @Headers("urlname:device-api")
    @PUT("/geelyTCAccess/tcservices/vehicle/telematics/{vin}")
    Observable<BaseResult<RemoteControlResponse>> remoteControl(@Path("vin") String var1,
                                                                @Body RemoteControlRequest var2);
    /**
     * 获取车辆运行状态
     */
    //@Headers("urlname:device-api")
    @GET("/geelyTCAccess/tcservices/vehicle/status/{vin}")
    Observable<BaseResult<VehicleStatusResponse>> getVehicleStatus(@Path("vin") String var1, @Query("userId")
            String var2, @Query("latest") String var3, @Query("target") String var4);

    /**
     * 获取车辆能力集
     */
    @GET("/geelyTCAccess/tcservices/capability/{vin}")
    Observable<BaseResult<TscVehicleCapabilityResponse>> getVehicleCapability(@Path("vin") String vin,
                                                                              @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex,
                                                                              @Query("vehicleType") int vehicleType, @Query("sortField") String sortField,
                                                                              @Query("direction") String direction);
    /**
     * 远程诊断车辆
     */
    @PUT("/geelyTCAccess/tcservices/vehicle/telematics/{vin}")
    Observable<BaseResult<DiagnosticsResponse>> diagnostics(@Path("vin") String var1,
                                                            @Body RemoteControlRequest var2);

    /**
     * 获取车辆属性状态
     */
    @Headers("urlname:device-api")
    @GET("/remote-control/vehicle/status/state/{vin}")
    Observable<BaseResult<VehicleState>> getVehicleState(@Path("vin") String var1, @Query("userId")
            String var2);

    /**
     * 获取阿里云推送配置
     */
    @GET("/device-platform/ecarx_device/device/{deviceId}/config")
    Observable<PushConfig> deviceConfig(@Path("deviceId") String deviceId,
                                        @Query("appId") String appId,
                                        @Query("X-CAPABILITY-SET") String gapp,
                                        @Query("appType") String appType,
                                        @Query("alipushId") String aliPushId,
                                        @Query("deviceClass") String deviceClass,
                                        @Query("modelCode") String modelCode,
                                        @Query("pushType") String pushType);

    /**
     * 初始化车辆警告与账号异地登录状态
     */
    @POST("/geelyTCAccess/tcservices/user/session/update")
    Observable<BaseResult<BaseData>> update(@Query("vin") String var1,@Body UpdateSession var2);

}
